enable routing and refactor controllers