Refactor code + support snapshots, start, stop