return anonymous function for substituter