before-8.14
refactor
replace type code with state/strategy