refine ac control logic