Separated patch creator from some helper methods.