prune code and some refactor

Signed-off-by: rootfs <hchen@redhat.com>