Refactor the modes to be driven by the configuration