replaced lambdas with use of partial