Refactor populate method

Reduce complexity.