refactor termios sample
add public