Simplify more and extract patch count from the function to allow separating out the drawing.