Cleanup if statements in main.c to be nicer