Use of CASE instead of if conditions