extracted url logic to classes