script engine improvements