Revert "Gateway should be singleton, not a prototype"

This reverts commit e4a6ae325041b82711f13d9fcb31250e54f647e1.