pulling common code into a base class