For each component your setting the areSomePlaces variable, but the logic for this is in 2 places. It would make sense to move all the logic related to setting areSomePlaces to the same place.