refactoring, extract snapshots js class