re-organize translation trees code