small code reorganization after snapshotting