refactored to returning url