refactoring for substructuring