Reworked validations to be more flexible and modular.