Yet another bits of code cleanup and UI improvements