admin-ui: refactor switch functionality