refactoring regarding to garbage collector