some code refine

Signed-off-by: Henry Chen <hchen@vmware.com>