Reduce nested function into inline.