Refactored ComposerGenerator with unit tests