Basic framework of handling grids.