refactor Composer.js