refactor c++ code composition into CodeComposer interface