finalized refactoring of url