storage: slightly refactor the API