consolidate create_name function