refactored a code type variable as a class (currently test fails)