I'm really surprised to see all these variables in this file.  It implies you haven't refactored enough yet.  None of this stuff should in in the routes; it should be in more specific modules, hidden away.