refactoring and adding clustering/preprocessing  templates scripts