modified script into an object-oriented model