Revert "Code cleanup, comments, minor refactoring"

This reverts commit 23ffcf4b68f4f8c9477ceaadde0cee0e06d5faad.