small refactoring in population.py