Factors out set_sources()