moving common code to base class