optimizing grid stylesheet manipulation