make a function

Signed-off-by: Sterncat <alex.fanxing@gmail.com>