begin to move ui code into the lib-ui