clean up wallet update function