This switch is in 3 different files with a somehow simialr content. This means it should be factorized somehow