use closures instead of big ol' funcs