Pythonic

Major re-factoring