structural changes and partial refactoring