Improve code reuse with abstract base class