Changed Repository and changed some virtual methods to non-virtual