Rework the execution logic to work when launched outside of IntelliJ.