add end newline
improve client framework