More generic instantiating function