modernize for recent versions