code cleanup. simplified event publish.