Separates components and moves to localStorage