move the routes code to it's own file