Simplify code by using smartlist_add_asprintf