Minor refactoring for Grid class
Refactor and pass tests