moved sanitize function inside inside the class