refactoring around history record
this commit breaks backward compatibility for AppState