refactored getSidebarItems in traits.