Refactored cleaning the Wikipedia template.