stat helper functions