Refactor ccgrep