More work on ui code