Refactor translator / extract mangler / simplify some code.