Improved UI handling.