Minor refactor in main