clean up lambda version of apply