Fixed routes
Refactored a little