storage: rearrange a couple methods, and extract method to function