refactor mux