Refactored things in preparation for adding a FileRepository.