begin refactor broken