simplifying API and example