refactor some steps back into a helper; update cc-hooks