add generic instantiate method