add repository pattern