Refactor grid for cleaner CSS output