Prevent deprecation warnings by switching .type -> .class