Refactoring scripts to proper configuration setup