refactored to 'repository' interface