Big Changes to the processing code.
Code cleanup and refactor