major changes to simplify API