refactor calculation of fitnesses