License replacement logic