wip
big refactor wip