working on first route and some code refactoring