Was running into difficultlies reasoning about the logic and couldn't write tests because it was all in react. Moved logic outside react, updated context, make it testable.