Refactored tests
Refactored tests
Refactored component factory
Refactored Gateway bootstrap
All tests passing