small optimization in grid construction