Clean up

a whole bunch of changes that clean up the code