routes to controller refactor