refactor wip
passing tests, refactor