refactor EventStructure.js