Refactored URL handling code out of navigator