Shall we refactor (try to get rid of any switch case) this further in this PR? Or wait for this one to be merged and do this in an other one.