refactor with new event plugin