Refactor to writers