Moved type conversion to file functions.