refactor get_data_type with class variable