Test storage; refactor test code