begin refactoring