More cleanups and simplification.