start implementing new simpler API from #1