Cleaned up teams code