Combine if/else block with switch for getOperatorList.