refactoring document with variable changes