Refactoring and fix memory leak bug