Refactor the code to make sure that include_attributes_list is only processed if it is a non-empty array.