refactoring core methods in interautomaton and cgautomaton class