bring in with a more flexible and powerful validation system & refactor code