Refactor to allow callables and not just closures