merge upstream update & factorize rules