Moved generics to sub-classes and made base classes abstract.