Refactor url assertion