better implementation to check for receivers of type Class