refractor snapshotAnalyzer code