 infix operator <|| { associativity left precedence 150 }
 infix operator <|? { associativity left precedence 150 }
 
-public func <| <A where A: Structured, A == A.StructureType>(value: NSManagedObject, key: String) -> Unboxed<A> {
+public func <| <A where A: Unboxing, A == A.StructureType>(value: NSManagedObject, key: String) -> Unboxed<A> {
     if let s = value.valueForKey(key) {
         return A.unbox(s)
     }
     return Unboxed.TypeMismatch("\(key) \(A.self)")
 }
 
-public func <|? <A where A: Structured, A == A.StructureType>(value: NSManagedObject, key: String) -> Unboxed<A?> {
+public func <|? <A where A: Unboxing, A == A.StructureType>(value: NSManagedObject, key: String) -> Unboxed<A?> {
     if let s = value.valueForKey(key) {
             return Unboxed<A?>.Success(A.unbox(s).value)
     }
     return Unboxed<A?>.Success(nil)
 }
 
-public func <|| <A where A: Structured, A == A.StructureType>(value: NSManagedObject, key: String) -> Unboxed<[A]> {
+public func <|| <A where A: Unboxing, A == A.StructureType>(value: NSManagedObject, key: String) -> Unboxed<[A]> {
     if let s = value.valueForKey(key) {
         return Array.unbox(s)
     }
     return Unboxed.TypeMismatch("\(key) \(A.self)")
 }
 
-extension NSManagedObject: Structured {
+extension NSManagedObject: Unboxing, Boxing {
     public static func unbox(value: AnyObject) -> Unboxed<NSManagedObject> {
         return Unboxed.Success(value as! NSManagedObject)
     }

    }
}

extension Int16: Structured {
    public static func unbox(value: AnyObject) -> Unboxed<Int16> {
        switch value {
        case let v as NSNumber: return Unboxed.Success(Int16(v.intValue))

FIXME: Think about this some more and try to find a way to do this without this weird protocol
setup and extension mess
*/
public protocol Unboxing {
    typealias StructureType = Self
    static func unbox(value: AnyObject) -> Unboxed<StructureType>
}


public protocol NSManagedStruct : Boxing, Unboxing {
    static func fromObject(object: NSManagedObject) -> Unboxed<Self>
}

