Added some helper functions to router file