turned WritePkgCode into method of Translator