improved and simplified scripts