Reduce redundant code by inheriting from different base class. Make more
methods final.