Refactored TeamFragment to reduce the complexity.