refactor history to use template