use switch/case instead of if/else