Minor refactor in main.