move parsing logic to request context