refactoring variables and scripts