refactoring
refactoring
destroy function added