some refactoring. get_datatypes() implemented