Remove some redundant code and change the confusing function name and argumment description

Signed-off-by: Huang Le <4tarhl@gmail.com>