refactoring of class of writer.. lack reshape the variables