refact launcher.js