Refactor populate to use do/end instead of brackets