Refactor: change factory to gateway directory
Refactor: change factory to gateway directory