continue refactor in prep for code generation of writer