Move the 'contains' logic into an association