Add repository pattern