handle generic relations