Use lambda expressions for input bindings

Just cherry-picked latest commit from local branch for mergeback into upstream repository.