refactoring events posts