Generalize sources a little bit to make them easier to use
update the code to use sources differently.