escape unicode + code cleanup