Restructuring framework for modular writing