refactor: use parse_{string,integer} and assert's from http.servlet for deduplication