refactored build_people