refactoring and URL transformation