use lambda to refactor flip