refactor ErlangGenerator