refining routes
moved js to separate file