saving layout refactoring