Cleanup, and more compartmentalization, also more comments that make sense