Shorter method with direct compare to undefined