global refactoring, part 1