refactor backup system