Lightswitch example a bit restructured