better attribute declaration detection