shape refactoring