collapse-sidebar refactoring