Fitness function refactoring