Switching from array calls to class calls