Use hasattr instead of private _keys() method