Revert "Revert "Revert "Many Changes, mostly refactoring"""

This reverts commit 5d9f29263af1ccf49aa6ce7a6346e533a54e7e1c.