Auto save and refactoring