revert to old API with a few small changes