More grid refactoring