Starting refactoring to support exchanges

I hate refactoring >:(