Refactored initializing of genetic algorithm