Refractor

Small change to use using to dispose of pen and brush.