refactoring + save changes