Refactor URL validations

Code Climate is a harsh mistress