Implemented generic repository pattern