moved logic from WareHouseNode to WareHouse