More tweaks to make grid more generic