UriValidator: refactoring + tests