refactor define directives and C block