add ability to pass a closure instead of an arg