optimize: downgroup function