refactoring to PEP syntax