Improved efficieny by loop switching light.
removed unused variable.
Release config setup