instanceof replaced with duck typing