improved locking averages cache