Revert "Major clean-up"

This reverts commit afca25f381d6219126aca98cf0765a3db034e6bd.