convenience method to get a containing declaration