Remove unnecessary instaceof checking