Remove duplicated code, only keep URL method, update tests.