general cleaning for opt scripts