refactored history