Added support for case
Simplify some code in if-tag