refactor- method for writing to mapstore