Refactor route creation for controllers