fill_hist refactor in cython