Refactored to use Filestore class.