Improved scripts and logging