Major code refactoring part 12.