Moved routesInDirectory() function to service provider

This function should only be loaded once on boot.