refactored init and destroy modules