Spatial partitioning of safe zone tiles and refactoring