Use one getattr() call instead of hasattr() + dot-lookup (faster)