Used correct writer generic function.
Code factoring, more needed.