refactor sidebar