Use generics to implement history.