Sidebar code clean up