refactor URLWrapper.as