refactroy script structure add new feature.