Refactor perfect.Mux