Refactored script engine classes.