Extract URL validation to a method