refactoring routes and adding routeNames array to make search for active routes faster
demo