Refactor folding toggles APIs