Some cleanup and simplifications