refactored to separate files and also used Express 4 router