refactoring telnet - rest comparison logic
final refactoring of comparison code