More cleanups and general versions of the classes