improve GREP and HISTORY setting