finialising database model and repository pattern classes