refactory normalizer and writer