change so tha it requires a callable rather than a class