Refactor Code

Signed-off-by: PengJingwen <pengjingwen1994@gmail.com>