Refactor launch files with if statement