need large refactor and make the relationshi graph update in real time