First version for source preservation running. Refactorings pending.