Refactor overall mean and write test.