gem structure cleaning and UTF8 encode fix + spec