move out the lambda function to improve the performance of cfi tree
extraction