refactorign: move relations to table