Trips controller refactoring