improve docs and simplify API