feat(bkgpslog):Add functions, group code into functions