added functionality to appFactory class to create a new state with tests