Well, as we don't use the new Erlang, there is no point in optimized syntax.

Anyway, rewriting in now, moving these `case`s to the separate function.