Do we really need these objects to be created on the heap? Also you are not deleting these objects at the end. I think just having them as local stack variable would suffice