snapshot refactor