Refactored to meet PEP 8