Factored out a method process_sources