refactoring initialization script