     }
 
     public init(value: Data) throws {
-        if (value.isEmpty) {
+        guard (!value.isEmpty) else {
             throw NanoMessageError.NoTopic
-        } else if (value.count > NanoMessage.maximumTopicLength) {
+        }
+
+        guard (value.count <= NanoMessage.maximumTopicLength) else {
             throw NanoMessageError.TopicLength
         }
 

    }

    public init(value: Array<Byte>) throws {
        if (value.isEmpty) {
            throw NanoMessageError.NoTopic
        } else if (value.count > NanoMessage.maximumTopicLength) {
            throw NanoMessageError.TopicLength
        }


    }

    public init(value: String, encoding: String.Encoding = NanoMessage.stringEncoding) throws {
        guard (!value.isEmpty) else {
            throw NanoMessageError.NoTopic
        }

        guard ((encoding == .utf8 && value.utf8.count <= NanoMessage.maximumTopicLength) ||
               (encoding == .utf16 && value.utf16.count <= NanoMessage.maximumTopicLength)) else {
            throw NanoMessageError.TopicLength
        }

