Improved bash scripts