Performance improvements related to wm-grid

Performance improvements related to wm-grid