binding clusures instead of passing struct