Getting more stuff out of main