moved routing out of main file