Refactor url helpers