Moving backup function to a class method