Added gate factory