several improvements on storage, api and flexibility