remove instanceof check