Replace lambdas with static functions for MSVC.