Refactored Index page:
Updated the cases Turn On / Turn Off to utilise the same codeblock.