refacotr telnet command def