code reorganization

In preparation for some aura fix