consolidating some classes and generic code cleaning.