complete refactor of validation handling