refactor switchlight into separate component