Cleanup of code to make behavior changes more clear in class structure

This is a working-PR. You can change it, clean it up further, squash, whatever you want.