Utilities for collecting statistics