Use more intelligent team switch policy and code cleanup.