lambda refactoring