more improvements to AA template