Cleaned up team ranks code.