Extract checking delegate into separate method. Make associated object keys static const void *. Thanks @robertjpayne