encapsulated the script as an object