Cook will shift to a role as executive chairman.