Extract method: add_to_registry
Extract failure method: assert_valid_name
Refactor generate_new_name and assert_valid_name regex