Based on Steve's suggestion, the ugly if-elif statement and multiple protocol module import calls are removed and replaced with exec statements using the protocol string.
Based on Steve's suggestion, the ugly if-elif statement and multiple protocol module import calls are removed and replaced with exec statements using the protocol string.