refactor All table and relationship