 
             // generate method
             indentLevel(level + 1)
-            if let modelName = modelName {
-                print("static func fromJSONDictionary(info: [String: AnyObject]) -> \(modelName)? {")
-            } else {
-                print("static func fromJSONDictionary(info: [String: AnyObject]) -> Model? {")
-            }
+            print("static func fromJSONDictionary(info: [String: AnyObject]) -> \(modelName ?? "Model")? {")
             for key in info.keys.sort() {
                 if let value = info[key] {
                     if value.isDictionaryOrArray {


            // return model
            indentLevel(level + 2)
            if let modelName = modelName {
                print("return \(modelName)(", terminator: "")
            } else {
                print("return Model(", terminator: "")
            }
            let lastIndex = info.keys.count - 1
            for (index, key) in info.keys.sort().enumerate() {
                let suffix = (index == lastIndex) ? ")" : ", "

        case .Dictionary(let info):
            // struct name
            indentLevel(level)
            print("struct \(modelName ?? "Model") {")

            // properties
            for key in info.keys.sort() {
