Replaced most traits with abstract classes to speed up compilation.