split one UI function out