simplifying ui code