DB backup refactor