Rewrite btreannounce as function and wrapper