refactor user history