more history tracking cleanup and refactor