refactor code to grep with quickfix