refactor ANN