Clean up dist.py with simpler protocol