this switch is duplicated everywhere, this meqns it needs to be facorized out. In combination with previous comment, the switchign should be solved at compiel time using a central template structure specialized on mode::start value