refactor scanScurroundingSpaces method