refactoring into multiple stages and adding a side by side editor