add ac automation and beautify