simplify grid creation function