refactory and add ssh