Updating inline code to class model