cleanup to use xevents