Use a dispatcher function.