Slightly refactored share.py