create new js file named route-core and move 2 functions to the new file