refactoring sidebar