HEAVY REFACTORING IN THIS COMMIT - WORK IN PROGRESS
The prior version is working though