Refactor team manager