Cleaning up the layout, optimizing code for the on/off button.

Fixes to clean up the code.