[wip] Refactor entities and transation manager retations