Removed redundant code and added some doco

Signed-off-by: stephenyao <stephenryao@gmail.com>