Refactored expand/collapse into toggleCollapse