Cleanup for readability and PEP8 compliance