Removed unnecessary instanceof check