simplifying some ui code