refactor history spec