Settings: code cleanup and add miss code for appsidebar