use react immutability helpers instead of making changes directly on the state