Key class is refactored