Code improvements plus moving on with tray app