WNS protocol code cleanup #48