Refactoring model validation/parsing to classes.