asnap.py refactoring