boil out common code