avf: move url utility functions in a separate file