added an option for the method cleanup and destroy refactored