Clean code in writer