Fix issue with encoding
Make some cleanup