refactor GetUserEvent function