Refactoring on urls and added test