simplifed api with HOFs and functional composition