improvements on ui code