General cleanup and simplification.