Refactored extraction of request body