refactoring
wip
finish refactor