switch-case code is replaced by the new one
That closes #35.