Added some folding related helpers