improve gate proto