refactor convert_types