Can we move this logic into a separate function like `resolve_source_arguments` or something similar to make this method slightly more sane? 

Also would be great if we can add some comments similar to this PRs description not to forget why we have this logic in the future...