refactor lambda expression