use associated_data.ids

Attempt to bring some optimization.