refactor: use directive. feature: add history of edited relations