Python 3.3 compatibility (and better style)