```JSON
DepartureLocations = [
  { 
    id: 1, 
    from: { id: 1, name: 'SFO' },
    to: [
      { id: 1, name: 'MUC', scheduledFlightTime: '...' }, 
      { id: 2, name: 'MAD', scheduledFlightTime: '...'}, 
      { id: 3, name: 'VLC' , scheduledFlightTime: '...'}, 
      { id: 4, name: 'LAX', scheduledFlightTime: '...' }, 
      { id: 5, name: 'BCN'', scheduledFlightTime: '...' }
   ]
  }//,{ ... }, { ... }, ....
}
]
```
That would allow you to remove that if-else. Calling a factory equals creating a new instance for a given model.