Use switch-case instead of if-statement for setting content type.