patch cleanup