Abstract classes for algebra