[WIP] Refactoring grid