remove unused imports
implement snapshot-driven stats collection
use __main__ module as entry point