major structural rewrite part 1