Make the view dimension properties constants
Make the state dimension properties constants
Make the total cells property a constant
Move common code to new iterateOverAllCells() method