Use the method for determining attribute methods rather than duplicating

I've been trying to reduce the number of places that care about
`attributes`, and its existence. We have a method for this check, let's
use it instead.
Merge pull request #16505 from sgrif/sg-attribute-internals

Use the method for determining attribute methods rather than duplicating