Refactor the code to allow for a better output

shouldn't this write in RAW mode to avoid issues with the style formatters ?