Same as with diff, probably better to move the implementation into a class. Then you can split up the backup code into smaller methods without adding a bunch of extra methods to classes that include this.