Cleaned up and documented new class add/remove code.