refactored dg_manager and added comment to sidebar.js