Removed code duplication in TypeConverter