Refactor history.module.js