Created model and collection logic.