Code clean up
python stuff