improve code where adding data to store