Improving command line scripts