switch statement on the type_value