Finished refactoring the GatewayProviderResolver and patched up unit tests.