         }
     }
     
-    private var filteredLines: [AELogLine] {
-        guard let filter = filterText else { return lines }
-        let filtered = lines.filter({ $0.description.containsString(filter) })
-        return filtered
-    }
+    private var filteredLines = [AELogLine]()
     
     private var filterText: String? {
         didSet {
-            if let text = filterText {
-                let characterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet()
-                let emptyText = text.stringByTrimmingCharactersInSet(characterSet) == ""
-                if !emptyText {
-                    filterActive = true
-                }
-            } else {
-                filterActive = false
-            }
+            filterActive = !isEmpty(filterText)
         }
     }
     
     private var filterActive = false {
         didSet {
+            filterActive ? updateFilteredLines() : clearFilteredLines()
             updateUI()
         }
+    }
+    
+    private func updateFilteredLines() {
+        guard let filter = filterText else { return }
+        let filtered = lines.filter({ $0.description.containsString(filter) })
+        filteredLines = filtered
+    }
+    
+    private func clearFilteredLines() {
+        filteredLines = [AELogLine]()
     }
 
     private var opacity: CGFloat = 1.0 {

        return maxOpacity
    }
    
    private func toggleControls() {
        let controlsVisible = controlsActive
        

    private func configureFilterTextField() {
        let textColor = settings.consoleTextColor
        textField.delegate = self
        textField.autocapitalizationType = .None
        textField.tintColor = textColor
        textField.font = UIFont.systemFontOfSize(14)
        textField.textColor = textColor
