refactored repository to allow custom tenant storage and to encapsulate disposal inside of closure