move lambda to method