copy old launcher code & refactor.