Refactor on processor and writer