Refactored get teams from conf to remove dulpicate code