refactor EventPool implementation into class template