Refactoring and saving