Cleanup

Cleanup and code simplification.