minor refactor to get rid of extraneous closure