Merge topic 'source-cleanup'

b86b6aaa4a Source: Cleanup and simplify some code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6673