Refactoring to use request objects