Perform some cleanup, re-organization, and documentation