Added support for splitings ways depending of the grid