Simplify sidebarClick function