refactor to move to relational