Started save refactor. Minor formatting changes in main file