LED and motor switch fix and refactor