replace hash-based API with opaque object API