Simplify Code by Removing 'nearByObstacles'