Refactor RelationManager