ring buffer and singleton utils