allow a writer to be passed in