refactored to use switch id instead of switch ip
Refactored to switch created to the function getSwitch