Refactor start of program