refractoring to share common code between AT and DX