Revert "Removed useless anonymous function wrapper"

This reverts commit 87390451605466cedddd5e6bf75fbfafa15208fa.