Refactored routes to controllers