New logic for saving stats into storage, refactor view