Refactors source structure