move patch functions into patch section