Improve the "template" sanitize sequence