more refactor for multi-team setup