Refactor for grids
Regexes for paths