Clean up and ordering of bits and pieces