fix and refactor inventario