Scripte refactored