Improve patch with renamed variables and functions