ac refactor