trying to implement repository pattern