Move get lambda to a method