set up model and repositories