pool switcher converted from the PHP we had