 
 import UIKit
 
-class WhenViewController : UIViewController, UITableViewDataSource, UITableViewDelegate {
+class WhenViewController : UIViewController {
     
-    @IBOutlet var tableView: UITableView?
-    var menuOptions: Array<MenuOption>
+    @IBOutlet weak private var tableView: UITableView?
+    lazy var menuOptions: [MenuOption] = {
+        return DataService().whenMenuOptions()
+    }()
     
     // MARK: View lifecycle
-    
-    required init?(coder aDecoder: NSCoder) {
-        
-        menuOptions = DataService().whenMenuOptions()
-        
-        super.init(coder: aDecoder)
-        
-        //NSNotificationCenter.defaultCenter().addObserver(self, selector: "reload:", name: NSMNetworkUpdateNotification, object: nil)
-    }
-    
     override func viewWillAppear(animated: Bool) {
         if let selectedIndex = tableView?.indexPathForSelectedRow
         {

        let cellIdentifier = menuOptions[indexPath.row].cellIdentifier
        let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath);
        
        if (indexPath.row + 1) % 1 == 0
        {
            cell.contentView.backgroundColor = UIColor(red: 238.0/255.0, green: 121.0/255.0, blue: 101.0/255.0, alpha: 1.0)
        }
        if (indexPath.row + 1) % 2 == 0
        {
            cell.contentView.backgroundColor = UIColor(red: 192.0/255.0, green: 105.0/255.0, blue: 155.0/255.0, alpha: 1.0)
        }
        if (indexPath.row + 1) % 3 == 0
        {
            cell.contentView.backgroundColor = UIColor(red: 239.0/255.0, green: 173.0/255.0, blue: 150.0/255.0, alpha: 1.0)
        }
        
        cell.textLabel?.text = menuOptions[indexPath.row].title
        
        if let subtitle = menuOptions[indexPath.row].subtitle

        }
    }
    
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        
        if segue.destinationViewController is EventViewController
        {
            let destination = segue.destinationViewController as! EventViewController
            let indexPath = tableView?.indexPathForSelectedRow!
            
            destination.titleText = menuOptions[(tableView?.indexPathForSelectedRow?.row)!].title
            destination.menuOptions = DataService().eventMenuOptions((tableView?.indexPathForSelectedRow?.row)!)
            
            // Centralise colours
            destination.backgroundColour = colorFor(indexPath!)
        }
    }
    
    private func colorFor(indexPath: NSIndexPath) -> UIColor {
        if (indexPath.row + 1) % 1 == 0
        {
            return UIColor.burntSiennaColor()
        }
        if (indexPath.row + 1) % 2 == 0
        {
            return UIColor.hopbushColor()
        }
        if (indexPath.row + 1) % 3 == 0
        {
            return UIColor.waxFlowerColor()
        }
        fatalError("wrong indexPath") // should never happen
    }
}

extension WhenViewController: UITableViewDataSource {
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return menuOptions.count
    }
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
