Simplify script a little