Refactor how source is added.