Improve the coding of storage part and add storage test