Refined model classes and prediction code.