add in-memory use_count for fifo-events
Remove duplicated code