Wrote tests for history model and associated refactoring