Refactoring the way lists are populated to reduce code.