begin refactor
refactored