Cleaning up project to use fewer globals.