Python 3 forward compatible Exceptions
Refactoring