Code factorization for label update