started refactor