XXX doco cleanup
XXX well, it works now...
XXX rework to avoid changing api
XXX error handling cleanup