implement Relations, model and dialog