Removed unused code, other cleanup.