cleaned up hive.py some more