Refactor history path