Refactor code to allow passing url fragmenent for named routes.