refactor predictRegion