refactoring, testing states in BA