perhaps extract this to a method with a name that explains the check it's doing.