refactoring storage table functions