small script improvements