implement AS, activate optimization.