Refactor methods used by both implementations into the base class.