Cleanup ssh

* ssh method cleanup
* ssh caller cleanup
* gateway related minor tweaks