Cellular automaton little fix and refactoring