Move code to encode source entries