Grid refactor