changed API for high-level interface slightly