translate code to new format