EZP-21191: refactored and tested storage and gateway