refactor worker groups initialization