 
 /// Parses user defined custom types.
 public func <-- <T: ArrowParsable>(left: inout T, right: JSON?) {
-    var temp: T? = nil
-    parseUserDefinedType(&temp, right: right)
-    if let t = temp {
-        left = t
-    }
+    setLeftIfIsResultNonNil(left: &left, right: right, function: <--)
 }
 
 /// Parses user defined optional custom types.
 public func <-- <T: ArrowParsable>(left: inout T?, right: JSON?) {
-    parseUserDefinedType(&left, right: right)
+    if let json = JSON(right?.data) {
+        var t = T.init()
+        t.deserialize(json)
+        left = t
+    }
 }
 
 /// Parses arrays of user defined custom types.
 public func <-- <T: ArrowParsable>(left: inout [T], right: JSON?) {
-    setLeftIfIsResultNonNil(left:&left, right:right, function: parseArrayOfUserDefinedTypes)
+    setLeftIfIsResultNonNil(left:&left, right:right, function: <--)
 }
 
 /// Parses optional arrays of user defined custom types.
 public func <-- <T: ArrowParsable>(left: inout [T]?, right: JSON?) {
-    parseArrayOfUserDefinedTypes(&left, right: right)
+    if let a = right?.data as? [AnyObject] {
+        left = a.map {
+            var t = T.init()
+            if let json = JSON($0) {
+                t.deserialize(json)
+            }
+            return t
+        }
+    }
 }
 
 /// Parses NSDates.
 public func <-- (left: inout Date, right: JSON?) {
-    var temp: Date? = nil
-    parseDate(&temp, right:right)
-    if let t = temp {
-        left = t
-    }
+    setLeftIfIsResultNonNil(left: &left, right: right, function: <--)
 }
 
 /// Parses optional NSDates.
 public func <-- (left: inout Date?, right: JSON?) {
-    parseDate(&left, right:right)
-}
-
-/// Parses NSURLs.
-public func <-- (left: inout URL, right: JSON?) {
-    var temp: URL? = nil
-    parseURL(&temp, right:right)
-    if let t = temp {
-        left = t
-    }
-}
-
-/// Parses optional NSURLs.
-public func <-- (left: inout URL?, right: JSON?) {
-    parseURL(&left, right: right)
-}
-
-
-/// Parses arrays of plain swift types.
-public func <-- <T>(left: inout [T], right: JSON?) {
-    setLeftIfIsResultNonNil(left:&left, right:right, function: parseArray)
-}
-
-/// Parses optional arrays of plain swift types.
-public func <-- <T>(left: inout [T]?, right: JSON?) {
-    parseArray(&left, right: right)
-}
-
-
-// MARK: - Private methods.
-
-func parseType<T>(_ left: inout T?, right: JSON?) {
-    if let v: T = right?.data as? T {
-        left = v
-    } else if let s = right?.data as? String {
-        parseString(&left, string:s)
-    }
-}
-
-func parseString<T>(_ left: inout T?, string: String) {
-    switch T.self {
-    case is Int.Type: if let v = Int(string) { left = v as? T }
-    case is UInt.Type: if let v = UInt(string) { left = v as? T }
-    case is Double.Type: if let v = Double(string) { left = v as? T }
-    case is Float.Type: if let v = Float(string) { left = v as? T }
-    case is CGFloat.Type: if let v = CGFloat.NativeType(string) { left = CGFloat(v) as? T }
-    case is Bool.Type: if let v = Int(string) { left = Bool(v != 0)  as? T}
-    default:()
-    }
-}
-
-func parseURL(_ left: inout URL?, right: JSON?) {
-    var str = ""
-    str <-- right
-    let set = CharacterSet.urlQueryAllowed
-    if let escapedStr = str.addingPercentEncoding(withAllowedCharacters: set),
-        let url = URL(string:escapedStr) {
-        left = url
-    }
-}
-
-func parseDate(_ left: inout Date?, right: JSON?) {
     // Use custom date format over high level setting when provided
     if let customFormat = right?.jsonDateFormat, let s = right?.data as? String {
         let df = DateFormatter()


/// Parses Array of enums.
public func <-- <T: RawRepresentable>(left: inout [T], right: JSON?) {
    if let array = right?.data as? [T.RawValue] {
        left = array.map { T.init(rawValue: $0) }.flatMap {$0}
    }
}

/// Parses Optional Array of enums.


infix operator <--

public func <-- <T>(left: inout T, right: JSON?) {
    setLeftIfIsResultNonNil(left: &left, right: right, function: parseType)
}

/// Parses optional default swift types.
