Converted script to class