Refactoring to separate reusable validators into a package