mass refactoring -- Grid is a type that handles grid logic