Refactor out a base class