Refactor ViewHistory