[feature] added history table
refactor the repository access