 import Dispatch
 import Foundation
 
-
-/**
-App version.
-
-TODO: -v command line arg
-*/
-let VERSION = "0.0.1"
-let MAX_WIDTH = 20.0
-
-var HAS_BATTERY = false
-var HAS_SMC     = false
-
-
-// TODO: This should probably be a serial queue
-// TODO: Custom serial attr prop creation causes runtime crash - Swift bug?
-var source = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER,
-                                    0, 0,
-                                    dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0))
-
-dispatch_source_set_timer(source, dispatch_time(DISPATCH_TIME_NOW, 0), 1 * NSEC_PER_SEC, 0)
-
-//
-//dispatch_source_set_event_handler(source, {
-//    // getyx is complex macro
-//    var x = getcurx(stdscr)
-//    var y = getcury(stdscr)
-//    
-//    //getyx(stdscr,row,col)
-//    move(20, 20)
-//    addstr("HELLO - YEAH GCD")
-//    move(y, x)
-//    refresh()
-//})
-//
-//// We have to resume the the dispatch source as it is paused by default
-//dispatch_resume(source)
-
-
-
-public struct Window {
-    var size  : (length : Int32, width : Int32) = (0, 0)
-    var pos   : (x : Int32, y : Int32) = (0, 0)
-}
+//------------------------------------------------------------------------------
+// MARK: GLOBAL STRUCTS
+//------------------------------------------------------------------------------
+
+
+/**
+Like an ncurses window
+*/
+struct Window {
+    var size : (length: Int32, width: Int32) = (0, 0)
+    var pos  : (x: Int32, y: Int32) = (0, 0)
+}
+
+
+//------------------------------------------------------------------------------
+// MARK:  GLOBAL PROTOCOLS
+//------------------------------------------------------------------------------
 
 
 protocol Widget {

            quit = true
            break
        case KEY_DOWN:
            var x = getcurx(stdscr)
            var y = getcury(stdscr)
            move(y + 1, x)

    }
}

// Cleanup
smc.close()
battery.close()
