Lots of code changes, cleanup, etc.