Add optional path kwarg to backup function
Backup function refactor