begin refactoring
wip