cleanup and handling charset conneg