snapshot refactoring