[FOLD] bug fixes
[FOLD] Remove unused functions