slightly generalize utils generator