Refactoring RegKey.py