kotlin lambdas & refactoring