some minor pythonization