Refactor sidebar.