population functions refactored