Refactored Http/Routing code