major refactor part 1 of ?

..
major refactor part 2 of 3?

..
major refactor part 3 of 3

..