differentiate between terminal and child encoding