Refactored code to use Vector pool and added .dispose() method