refactored in accordance with PEP-0008