removed dependency between middleware and storage