#2 make client parameter-agnostic and some refactor
 #2 updated doc