refactor get_field_type