I think `hasattr` instead of `getattr` would make more sense right here wouldn't it?