Refactor calculation of surrounding locations