Refactored custom history tracking and evaluation into separate model.