Reordered Code Flow

I've reordered the flow of code so that that it is easier to read the
flow of execution/order from top to bottom without scrolling up and down
so much to search for stuff. No changes were made to existing code
operation.

This also helps with the preparation of the subscriber system
integration.