Deprecate old 'url' field, remove dead code and some refactorings