trying to organize ui code.