Some refactoring, and GeneticAlg stub.