Rework the public functional API