large refactoring of many source files