Refactor tool and bring it closer to PEP-8.