Avoid duplication of url construction logic