restruct the functions of eventquue