some code organisation

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