Make dd_generate_tags more flexible