This is a temporary copy/pasting from a few line above. My take on the switch is to try to keep as many code as is and to improve later to avoid side-effects. Thoughts?