better code structure for creating translation trees