Refactoring to separate old and new model building/checking code.