grid refactored