refactorize main.js is now a composition root