Abstracted out telnet code.