Factorize enum_type and boolean_type mutual_information code

Just some code simplication