Used metaprogramming to automatically get lambda.