snapshot - refactoring for better testing