Make script less dumb