create create_instance _for function