improve relationship handling