moved store logic to isolated controller