Add loading and localStorage support