refactor ui to reduce add_cds_menu method length