remove non-utf8 character and clean up for consistency
remove unused function