Revert "lots of cleanup"

This reverts commit 5b59f359bc1217082415fe654cfe78c48ab4a733.