Refactor validator to be more scalable and interlace value and type validation.