slight refactor
removed unnecessary format check
faster way of checking for url