slight refactoring, use time constants in lib_stats