Added request controller, partial refactoring