some improvements to early tui implementation