Factor out teamWithSourceId. Add null checks and warnings in case expected resources are missing