Refactors controller routing