refactor request and response classes