better interfaces -- factor out API