some code clean-up to better stick to python3 and PEP-8