simplifies recursion methods in gate