Convert anonymous functions to inner class functions