some code organization

Signed-off-by: zwliew <zhaoweiliew@gmail.com>