trimming ui code