some cleanup for the ui code