reconstruct some key functions

Signed-off-by: blackjack201312 <blackjack201303@gmail.com>