factor out host connection code
add reset operation