add cfg class, implement fold to percent