refactored eventStore