ensuring backup copy whilst refactoring code