Instantiate models and assign IDs automatically